import { mapState } from "vuex"
import { loginInfo } from "../api/auth.js"

export default {
	methods: {
		// 更新用户信息
		async re_user_info() {
			uni.showLoading({
				title: '加载中'
			})
			const { code,body } = await loginInfo()
			uni.hideLoading()
			if (code == 0) {
				let user_info = uni.getStorageSync("userInfo") || {}
				
				user_info = {...user_info,...body.memberVO}
				
				uni.setStorageSync("userInfo",user_info)
				 
				this.userInfo = user_info
				
			}
		}
	}
}
